package com.itcat.controller;

import com.itcat.common.CommonResult;
import com.itcat.mysql.pojo.CmsPrefrenceArea;
import com.itcat.service.CmsPrefrenceAreaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Jerry Broker
 * @project_name rainbow-mall
 * @create 2022-04-03 14:29
 */
@RestController
@RequestMapping("/prefrenceArea")
public class CmsPrefrenceAreaController {

    @Autowired
    private CmsPrefrenceAreaService cmsPrefrenceAreaService;

    /**
     * 获取所有商品优选
     * @return
     */
    @GetMapping("/listAll")
    public CommonResult listAll(){
        List<CmsPrefrenceArea> list = cmsPrefrenceAreaService.listAll();
        return CommonResult.success(list);
    }
}
